
import {request} from "./request"

 export function PhoneLogin(phone,password){  //手机号登陆时的请求
    return request({
        url:"/login/cellphone",
        method:"post",
        withCredentials: true,
        data:{
          phone,
          password,
          timerstamp:Date.now(),
        }
    })
}

export function loginOut(){   //退出时的请求
  return request({
    url:"/logout",
    withCredentials: true,
    params:{
      timerstamp:Date.now(),
     }
  })
}

export function LoginStatus(){ //登陆状态
     return request({
       url:"/login/status",
       withCredentials: true,
       params:{
        timerstamp:Date.now(),
       }
     })
}

export function mySignin(type){  //登陆后签到
    return  request({
      url:"/daily_signin",
      withCredentials: true,
      params:{
        type
      }
    })
}

export function VIP(){       //登陆后用户等级信息
  return request({
    url:"/user/level",
    withCredentials: true
  })
}

export function userSubcount(){ //登陆后获取用户信息 ,歌单，收藏，mv, dj 数量
   return request({
   url:"/user/subcount",
    withCredentials: true
   })
}

export function userPlaylist(uid) {  //获取用户歌单
  return request({
    url:"/user/playlist",
    withCredentials: true,
    params:{
      uid,
      timestamp:Date.now()
    }
  })
}

export function sublist(){  //收藏的歌手列表
  return request({
     url:"/artist/sublist",
     withCredentials: true
    })
}

export function Mv(){  //我的mv列表
  return request({
    url:"/mv/sublist",
    withCredentials: true
   })
}
export function cover(id , imgSize){   //歌单封面上传
  return request({
    method:'post',
     url:"/playlist/cover/update",
     headers:{'Content-Type': 'multipart/form-data'},
     params:{
        id,
        imgSize,
        timerstamp:Date.now(),
     }
  })
}

export function playlist_detail(id){  //获取歌单详情
  return request({
    url:"/playlist/detail",
    withCredentials: true,
    params:{
      id,
      timerstamp:Date.now()
    }
  })
}

export function song_detail(ids){  //获取歌曲详情歌曲列表
  return request({
    url:"/song/detail",
    withCredentials: true,
    params:{
      ids
    }
  })
}

//登录二维码生成key
export function QRKey(){
   return request({
     url:"/login/qr/key",
     withCredentials: true,
     params:{
      timerstamp:Date.now()
     }
   })
}
//生成二维码登录
export function QRcreate(key){
  return request({
    url:"/login/qr/create",
    withCredentials: true,
    params:{
        key,
        qrimg:true,
        timerstamp:Date.now()
    }
  })
}
//二维码状态检测 
export function QRcheck(key){
  return request({
     url:"/login/qr/check",
     withCredentials: true,
     params:{
       key,
       timerstamp:Date.now()
     }
  })
}